<script>
 export default {
   name:'Aside',
    methods: {
      handleOpen(key, keyPath) {
        if (keyPath.length>1){
          var path = keyPath[0]+keyPath[1];
          this.$router.push(path)
        }
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        this.$router.push('/')
        console.log(key, keyPath);
      }
    }
  }</script>

<template>
  <div>
    <el-row>
    <el-col :span="24" style="overflow: clip">
      <el-menu
        default-active="2"
        class="el-menu-vertical-demo"
        @open="handleOpen"
        @close="handleClose"
       >
        <el-submenu index="/user">
          <template slot="title">
            <i class="el-icon-location"></i>
            <span>用户管理</span>
          </template>
          <el-menu-item-group>
            <el-menu-item @click="$router.push('/user/normal')">普通用户</el-menu-item>
          </el-menu-item-group>
        </el-submenu>
        <el-menu-item @click="$router.push('/shopgoods')">
          <i class="el-icon-menu" ></i>
          <span slot="title">超市商品管理</span>
        </el-menu-item>
        <el-menu-item @click="$router.push('/hotel')" >
          <i class="el-icon-document"></i>
          <span slot="title">酒店管理</span>
        </el-menu-item>
        <el-menu-item @click="$router.push('/ticket')">
          <i class="el-icon-setting"></i>
          <span slot="title">车票管理</span>
        </el-menu-item>
        <el-menu-item @click="$router.push('/car')">
          <i class="el-icon-setting"></i>
          <span slot="title">车次管理</span>
        </el-menu-item>
        <el-menu-item @click="$router.push('/city')">
          <i class="el-icon-setting"></i>
          <span slot="title">城市管理</span>
        </el-menu-item>
        <el-menu-item @click="$router.push('/house')">
          <i class="el-icon-setting"></i>
          <span slot="title">酒店房型管理</span>
        </el-menu-item>
      </el-menu>
    </el-col>
    </el-row>
  </div>
</template>

<style scoped>
.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.el-menu{
  height: 758px;
}


</style>
